package com.cy.ppj.web.front.product;

import com.cy.ppj.model.Result;
import com.cy.ppj.service.product.ProductService;
import com.cy.ppj.service.product.TagService;
import com.cy.ppj.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @description: 前台产品管理
 * @author: Ocean
 * @create: 2018-07-18 10:01
 **/
@Slf4j
@RestController
@RequestMapping("/product/tag")
@Api(tags = "前台产品标签")
public class ProductTagController extends BaseController {

    @Autowired
    private ProductService productService;
    @Autowired
    private TagService tagService;

    @ApiOperation("根据产品类型获取标签")
    @GetMapping("/get/{typeId}")
    public Result getByTypeId(@ApiParam(value = "产品类型ID", required = true, example = "0")
                                     @PathVariable Long typeId) {
        return ok("查询成功", tagService.getTagsByTypeIdInCache(typeId));
    }

}
